package com.dcw.lixb.designmode.nullobj;

/**
 * @author lixiaobin
 * @date 2020-07-29 15:37:54
 * @desc 描述信息
 */
public class CustomerFactory {
    public static final String[] names = {"Rob", "Lily", "John"};

    public static AbstractCustomer getCustomer(String name) {
        for (String n : names) {
            if (n.equalsIgnoreCase(name)) {
                return new RealCustomer(n);
            }
        }

        return new NullCustomer();
    }
}
